package com.nibian.nibian.activity;

import android.content.Intent;
import android.os.Handler;
import android.view.WindowManager;

import com.nibian.nibian.R;
import com.nibian.nibian.bean.TextBean;
import com.nibian.nibian.utils.UiUtils;
import com.nibianplus.base.BaseActivity;
import com.nibianplus.base.BaseObject;

/**
 * @创建者 luck
 * @创建时间 ${DATA} 19:01
 * @描述 ${欢迎界面}
 * @更新者 $Author$
 * @更新时间 $Date$
 * @更新描述 ${TODO}
 */
public class WelcomeActivity extends BaseActivity {
    @Override
    protected void initView() {
        //去掉信息栏
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_welcome);

        initData();
    }

    /**
     * 初始化数据
     * 界面完成初始化，延迟3秒加载数据
     */
    public void initData() {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent(UiUtils.getContext(), MainActivity.class);
                startActivity(intent);
                finish();
            }
        },2000);
    }

    /**
     * 单列
     * @retur
     */
    @Override
    protected BaseObject createDataObject() {
        return TextBean.getInstance(getTagName());
    }

    /**
     * 设置数据
     * @param dataObject
     * @param tag
     */
    @Override
    public void refreshUI(BaseObject dataObject, int tag) {

    }
}
